﻿using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL.Utils
{
    public static class SqlUtils
    {
        public static List<IConditionalModel> JsonToConditionalModels(string json)
        {
            List<IConditionalModel> result = new List<IConditionalModel>();

            if (string.IsNullOrEmpty(json))
            {
                return result;
            }

            List<ConditionalModel> ConditionalModels = JsonConvert.DeserializeObject<List<ConditionalModel>>(json);

            foreach (ConditionalModel conditional in ConditionalModels)
            {
                result.Add(conditional);
            }
            return result;
        }
    }
}
